<template>
	<view class="all">
		<view>
			<!-- 2.0.19支持autoBack，默认为false -->
			<u-navbar title="编辑昵称" @rightClick="rightClick(name)"  :autoBack="true" rightText='完成'>
			</u-navbar>
		</view>
		<view style="height: var(--status-bar-height);">
			<!-- app状态栏高度占位 -->
		</view>
		<view class="idmsg">
			<view class="name">
				<u--input
				:focus="true"
				    placeholder="请输入内容"
				    border="none"
					clearable
				    v-model="name"
				  ></u--input>
				
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:''
			};
		},
		onLoad(option){
			console.log(Object.keys(option) ,'pppp');
			this.name=Object.keys(option)[0]
		},
		methods:{
			rightClick(a){
				// console.log(a,'jjjjj');
				// if(!a){
				// 	uni.showToast({
				// 		title: '昵称不能为空',
				// 		icon: 'none'
				// 	});
				// 	return
				// }
				// else{
					var pages = getCurrentPages();
					var prevPage = pages[pages.length - 2]; //上一个页面
					console.log(pages,prevPage,'////');
					prevPage.$vm.otherFun(a);//重点$vm
					uni.navigateBack()
				}
				
			// },
		}
	}
</script>

<style lang="scss" scoped>
	.all{
		background-color: #f6f6f6;
		padding-top:10px ;
		.idmsg{
			margin-top: 144px;
			background-color: #ffffff;
			.name{
				padding: 0 10px;
				font-size: 16px;
				height: 55px;
				line-height: 55px;
				font-weight: Medium;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-bottom: 0.5px  #f6f6f6 solid;
			}
		}
	}
	
</style>
